package com.bigegg.employee.service.impl;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.bigegg.employee.domain.RegisterInfo;
import com.bigegg.employee.domain.TypeSchoolUserInfo;
import com.bigegg.employee.domain.TypeUserInfo;
import com.bigegg.employee.service.TypeUserService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


/**
 * 学校端用户类型
 *
 * @author sun
 */
@Component
@Order(0)
public class TypeUser0Service implements TypeUserService {


    public static final String USER_ROLE = "学校";

    public static final int USER_TYPE = 0;


    @Override
    public int getType() {
        return USER_TYPE;
    }

    @Override
    public String getTypeName() {
        return USER_ROLE;
    }

    @Override
    public boolean support(String role) {
        return USER_ROLE.equals(role);
    }

    @Override
    public void register(RegisterInfo registerInfo) {
        throw new RuntimeException("用户类型 [" + USER_ROLE + "] 不支持注册功能，请超级管理员进行添加！");
    }


    /**
     * 学校端用户信息
     *
     * @param user 登录用户
     * @return TypeUserInfo
     */
    @Override
    public TypeUserInfo getLoginUserInfo(SysUser user) {

        return new TypeSchoolUserInfo(user);
    }

    @Override
    public TypeUserInfo getTypeUserInfo(Long userId) {
        return null;
    }
}
